// 现代化配色方案
$primary-color: #4f46e5;
$secondary-color: #10b981;
$danger-color: #ef4444;
$warning-color: #f59e0b;
$info-color: #3b82f6;
$success-color: #22c55e;
$text-color: #374151;
$light-text-color: #6b7280;
$border-color: #e5e7eb;
$background-color: #f9fafb;
$white-color: #ffffff;

// 扩展配色方案
$gradient-primary: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
$gradient-success: linear-gradient(135deg, #10b981 0%, #22c55e 100%);
$gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
$gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
$shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
$shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
$shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

// 添加新的颜色变量
$primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
$success-gradient: linear-gradient(135deg, #10b981 0%, #22c55e 100%);
$warning-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
$danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

// 卡片样式
.modern-card {
  background: $white-color;
  border-radius: 1rem;
  box-shadow: $shadow-md;
  border: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: $gradient-primary;
  }

  &:hover {
    box-shadow: $shadow-lg;
    transform: translateY(-2px);
  }

  .card-header {
    background: transparent;
    border-bottom: 1px solid $border-color;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    
    h3, h4, h5 {
      margin: 0;
      color: $text-color;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 0.5rem;

      i {
        color: $primary-color;
        font-size: 1.25em;
      }
    }
  }

  .card-body {
    padding: 1.5rem;
  }
}

// 表单样式
.modern-form {
  .form-group {
    margin-bottom: 1.25rem;
    position: relative;
    
    label {
      display: block;
      margin-bottom: 0.5rem;
      color: $text-color;
      font-weight: 500;
      font-size: 0.875rem;
      transition: all 0.2s ease;
      
      &.required::after {
        content: "*";
        color: $danger-color;
        margin-left: 4px;
      }
    }
    
    .form-control {
      border-radius: 0.5rem;
      border: 1px solid $border-color;
      padding: 0.625rem 1rem;
      transition: all 0.2s ease;
      background: $white-color;
      
      &:focus {
        border-color: $primary-color;
        box-shadow: 0 0 0 3px rgba($primary-color, 0.1);
        background: rgba($primary-color, 0.02);
      }

      &::placeholder {
        color: rgba($text-color, 0.4);
      }
    }
    
    select.form-control {
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 0.75rem center;
      background-size: 1rem;
      padding-right: 2.5rem;
    }
  }
}

// 按钮样式
.modern-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  
  i {
    font-size: 1rem;
    transition: transform 0.2s ease;
  }
  
  &:hover i {
    transform: scale(1.1);
  }
  
  &.btn-primary {
    background: $gradient-primary;
    color: $white-color;
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: $shadow-md;
    }
  }
  
  &.btn-success {
    background: $gradient-success;
    color: $white-color;
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: $shadow-md;
    }
  }
  
  &.btn-danger {
    background: $gradient-danger;
    color: $white-color;
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: $shadow-md;
    }
  }

  &:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    &:hover {
      transform: none;
      box-shadow: none;
    }
  }
}

// 表格样式
.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  
  th {
    background: rgba($primary-color, 0.05);
    color: $text-color;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid rgba($primary-color, 0.1);
    position: relative;
    transition: all 0.2s ease;

    &:hover {
      background: rgba($primary-color, 0.1);
    }
  }
  
  td {
    padding: 1rem;
    border-bottom: 1px solid $border-color;
    color: $text-color;
    vertical-align: middle;
    transition: all 0.2s ease;
  }
  
  tbody tr {
    transition: all 0.2s ease;
    
    &:hover {
      background: rgba($primary-color, 0.05);
      transform: scale(1.001);
      box-shadow: $shadow-sm;
      
      td {
        color: $primary-color;
      }
    }
  }
}

// 状态标签
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.2s ease;
  
  &.status-pending {
    background: rgba($warning-color, 0.1);
    color: $warning-color;
    border: 1px solid rgba($warning-color, 0.2);
    
    &:hover {
      background: rgba($warning-color, 0.15);
      transform: translateY(-1px);
    }
  }
  
  &.status-completed {
    background: rgba($success-color, 0.1);
    color: $success-color;
    border: 1px solid rgba($success-color, 0.2);
    
    &:hover {
      background: rgba($success-color, 0.15);
      transform: translateY(-1px);
    }
  }
  
  &.status-processing {
    background: rgba($info-color, 0.1);
    color: $info-color;
    border: 1px solid rgba($info-color, 0.2);
    
    &:hover {
      background: rgba($info-color, 0.15);
      transform: translateY(-1px);
    }
  }
}

// 动画
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

// 搜索区域样式
.search-area {
  background: $white-color;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid $border-color;
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: $primary-gradient;
  }
  
  .search-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: $text-color;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid $border-color;
    
    i {
      color: $primary-color;
      font-size: 1.25em;
    }
  }

  .form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid $border-color;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
    background: $white-color;
    
    &:focus {
      border-color: $primary-color;
      box-shadow: 0 0 0 3px rgba($primary-color, 0.1);
      background: rgba($primary-color, 0.02);
    }

    &::placeholder {
      color: rgba($text-color, 0.4);
    }
  }

  .input-group {
    .input-group-text {
      background: rgba($primary-color, 0.05);
      border-color: $border-color;
      color: $primary-color;
    }
  }
}

// 工具栏样式
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba($primary-color, 0.02);
  border-radius: 0.5rem;
  
  .left-actions, .right-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
  }
}

// 加载动画
.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid rgba($primary-color, 0.1);
  border-top-color: $primary-color;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

// 文件上传区域
.file-upload-area {
  border: 2px dashed $border-color;
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background: rgba($primary-color, 0.02);
  
  &:hover {
    border-color: $primary-color;
    background: rgba($primary-color, 0.05);
    transform: translateY(-2px);
  }
  
  .upload-icon {
    font-size: 2.5rem;
    color: $primary-color;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
  }
  
  &:hover .upload-icon {
    transform: scale(1.1);
  }
  
  .upload-text {
    color: $text-color;
    font-weight: 500;
  }
}

// 新增：信息展示组件样式
.info-display {
  background: $white-color;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid $border-color;
  transition: all 0.2s ease;
  
  &:hover {
    box-shadow: $shadow-sm;
    border-color: $primary-color;
  }
  
  .info-label {
    font-size: 0.875rem;
    color: $light-text-color;
    margin-bottom: 0.25rem;
  }
  
  .info-value {
    font-size: 1rem;
    color: $text-color;
    font-weight: 500;
    
    i {
      color: $primary-color;
      margin-right: 0.5rem;
    }
  }
}

// 新增：页面过渡动画
.page-transition {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

// 新增：数据统计卡片
.stat-card {
  background: $white-color;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: $shadow-sm;
  transition: all 0.3s ease;
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: $shadow-md;
  }
  
  .stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: rgba($primary-color, 0.1);
    color: $primary-color;
    font-size: 1.5rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: $text-color;
    margin-bottom: 0.5rem;
  }
  
  .stat-label {
    font-size: 0.875rem;
    color: $light-text-color;
  }
}

// 增强搜索区域样式
.search-area {
  background: $white-color;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid $border-color;
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: $primary-gradient;
  }
  
  .search-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: $text-color;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid $border-color;
    
    i {
      color: $primary-color;
      font-size: 1.25em;
    }
  }

  .form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid $border-color;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
    background: $white-color;
    
    &:focus {
      border-color: $primary-color;
      box-shadow: 0 0 0 3px rgba($primary-color, 0.1);
      background: rgba($primary-color, 0.02);
    }

    &::placeholder {
      color: rgba($text-color, 0.4);
    }
  }

  .input-group {
    .input-group-text {
      background: rgba($primary-color, 0.05);
      border-color: $border-color;
      color: $primary-color;
    }
  }
}

// 增强按钮样式
.btn {
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  
  i {
    font-size: 1rem;
    transition: transform 0.2s ease;
  }
  
  &:hover i {
    transform: scale(1.1);
  }

  &.btn-primary {
    background: $primary-gradient;
    color: $white-color;
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
  }

  &.btn-success {
    background: $success-gradient;
    color: $white-color;
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
  }
}

// 增强表格样式
.table {
  width: 100%;
  margin-bottom: 1rem;
  background-color: transparent;
  border-collapse: separate;
  border-spacing: 0;

  th, td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid $border-color;
  }

  thead th {
    background: rgba($primary-color, 0.05);
    font-weight: 600;
    color: $text-color;
    border-bottom: 2px solid rgba($primary-color, 0.1);
    white-space: nowrap;
    
    &:first-child {
      border-top-left-radius: 0.5rem;
    }
    
    &:last-child {
      border-top-right-radius: 0.5rem;
    }
  }

  tbody {
    tr {
      transition: all 0.2s ease;
      
      &:hover {
        background: rgba($primary-color, 0.02);
        transform: translateY(-1px);
        box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.05);
      }

      td {
        transition: all 0.2s ease;
      }
    }
  }
}

// 增强日期选择器样式
input[type="date"] {
  position: relative;
  
  &::-webkit-calendar-picker-indicator {
    background: transparent;
    cursor: pointer;
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    opacity: 0.5;
    
    &:hover {
      opacity: 1;
    }
  }
}

// 增强复选框样式
.form-check {
  .form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.15em;
    background-color: $white-color;
    border: 1px solid $border-color;
    transition: all 0.2s ease;
    
    &:checked {
      background-color: $primary-color;
      border-color: $primary-color;
    }
    
    &:focus {
      box-shadow: 0 0 0 3px rgba($primary-color, 0.1);
      border-color: $primary-color;
    }
  }
}

// 增强操作按钮组样式
.action-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid $border-color;
}

// 增强状态标签样式
.status-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.2s ease;
  
  i {
    font-size: 0.875rem;
  }
  
  &.status-pending {
    background: rgba($warning-color, 0.1);
    color: $warning-color;
    border: 1px solid rgba($warning-color, 0.2);
  }
  
  &.status-completed {
    background: rgba($success-color, 0.1);
    color: $success-color;
    border: 1px solid rgba($success-color, 0.2);
  }
  
  &.status-processing {
    background: rgba($info-color, 0.1);
    color: $info-color;
    border: 1px solid rgba($info-color, 0.2);
  }
}

// 响应式设计
@media (max-width: 768px) {
  .modern-card {
    border-radius: 0.5rem;
    
    .card-header {
      padding: 1rem;
      flex-direction: column;
      gap: 0.5rem;
      
      h3, h4, h5 {
        font-size: 1.1rem;
      }
    }
    
    .card-body {
      padding: 1rem;
    }
  }
  
  .toolbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    
    .left-actions, .right-actions {
      width: 100%;
      justify-content: center;
      flex-wrap: wrap;
    }
  }
  
  .modern-table {
    th, td {
      padding: 0.75rem;
      font-size: 0.875rem;
    }
  }
  
  .stat-card {
    margin-bottom: 1rem;
  }
  
  .search-area {
    padding: 1rem;
    
    .search-title {
      font-size: 1rem;
      margin-bottom: 1rem;
    }
  }
  
  .table {
    th, td {
      padding: 0.75rem;
      font-size: 0.875rem;
    }
  }
  
  .btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
} 